Ext.QuickTips.init();
Ext.define('Module.sjfx.SyjszsNow', {
	extend : 'Ext.panel.Panel',
	alias : 'widget.syjszs',
	requires: ['Sh.ux.VideoPlayer','Module.System.Gsgg'],
	layout:'fit',
	border: false,
	title: '平台首页',
	config:{
		bjs: [],
		bjid: undefined,
		store: undefined,
		vindex: 0,
		isSx:false,   //是否上一组、下一组
	},
	initComponent : function() {
		var me = this;
		me.store = Ext.create('Ext.data.Store', {
		     fields: [],
		     proxy: {
		         type: 'ajax',
		         url: 'wgSyjsAction/getWgSyjsList.do'
		     },
		     autoLoad: false
		 });
		
		me.on('afterrender',function(){
			me.store.load({callback: function(records){
				me.switchVideo(0);
				me.getGsggList();
				me.initLoopImg();
				me.ruanTask();
			}});
		});
		//首次登陆修改密码
		Ext.Ajax.request({
		    url: 'user/getUserLoginCount.do',
		    params: {userid:user.id},
		    success: function(response){
		        var text = response.responseText;
		        var data = Ext.decode(text);
		        if(data == 1){
		        	setTimeout(function(){
		    			me.changePwd('first');
		    		},1000);
		        }
		    }
		});
		//密码过期修改密码
		Ext.Ajax.request({
		    url: 'user/selectUserByAccount.do',
		    params: {account:user.account},
		    success: function(response){
		        var text = response.responseText;
		        var data = Ext.decode(text);
		        if(data == 1){
		        	setTimeout(function(){
		    			me.changePwd();
		    		},1000);
		        }
		    }
		});
		
		
		
		var centerPanel =Ext.create('Ext.panel.Panel',{
			region: 'center',
			layout:'column',
			border:false,
			autoScroll: true,
			bodyPadding: '15 30 30 30',
			defaults: {
				border:false,
				bodyPadding: 3,
				columnWidth: 1/3
			},
			items: [{
				height:220,
				columnWidth: 2/3,
				xtype: 'panel',
				html: '<div id="img-loop" style="border-radius: 5px;width:100%;padding:2;position: relative;border:1px solid #028b83;height:101%;cursor: pointer;">'
							+'<a id="imgId" onclick="javascript:Ext.getCmp(\''+me.id+'\').getImgclick()">'
								+'<img alt="" width="100%" height="100%">'
								+'<span style="display:none" id="imgTitle"></span>'
								+'<span style="display:none" id="imgNr"></span>'
								+'<span style="display:none" id="imgUserName"></span>'
								+'<span style="display:none" id="imgUptime"></span>'
							+'</a>'
							+'<div class="img-loop-prev"></div>'
							+'<div class="img-loop-next"></div>'
							+'<div class="img-loop-bar">'
							+'[0/0]'
							+'</div>'
					+'</div>'
			},{
	    		xtype: 'panel',
				layout: 'fit',
				height: 220,
				bodyStyle: {
				     borderStyle: 'solid'
		        },
				html: '<div style="border-radius: 5px;border:1px solid #028b83;height:101%">'
							+'<div style="background-color:#41CABB;width:100%;height:35px;">'
									+'<div style="position:absolute;width:auto;height:35px;line-height:35px;padding-left:10px;font-weight: bold;color:#fff;float:left;">'
										+'<span>公示公告</span>'
									+'</div>'
									+'<div style="float:right;width:auto;width:33px;height:35px;line-height:35px;margin-right:10px;">'
										+'<a style="text-decoration:none;" href="javascript:Ext.getCmp(\''+me.id+'\').genduoWin()">更多&#62;</a>'
									+'</div><br/><br/>'
							 +'</div>'
							 +'<table id="gsggListTab" style="top:7px;width:100%;height:25px;line-height:18px;left:10px;font-style:normal;font-size: 8;padding-left:10px;position:relative;"></table>'
						+'</div>'
			},
			{
				id:me.id+'-bt',
				border: 1,
				columnWidth: 1,
				xtype: 'fieldset',
				html: '<span style="font-size: 18px;font-weight: bold;">没有警示内容。</span>',
				'margin':'10 3 5 4',
			    style: {
			        borderColor: '#14a296',
			        backgroundColor:'#DBF2EF',
			        'border-radius': '5px'
			    }
			},
			 {
				xtype: 'panel',
				items:[{  
				    xtype: 'box', //或者xtype: 'component',  
				    style: {
				    	'margin-bottom':'-2px'
				    },
				    height: 27, //图片高度  
				    autoEl: {  
				        tag: 'img',    //指定为img标签  
				        src: 'images/syjszs/zc.png'    //指定url路径  
				    }  
				},{
					xtype: 'panel',
					id:me.id+'-zcpalyer',
					layout: 'fit',
					height: 250,
					border: true,
					bodyStyle: {
						 borderColor: '#028b83',
					     backgroundColor:'#DBF2EF',
					     borderStyle: 'solid'
			        }
				},{
			    	xtype:"fieldset",
			    	title:'正常视频描述',
			    	height:225,
					style: {
						borderColor:'#40B0A3',
			            backgroundColor:'#DBF2EF',
				        'border-radius': '5px'
			        },
			        defaults: {
			    		labelWidth: 60
					},
			        border:true,
				        items:[{
							fieldLabel: '视频名称',
							style:"margin-top:13",
							xtype: 'displayfield',
							id:me.id+'-zcvName'
						},{
							fieldLabel: '详情',
							xtype: 'displayfield',
							id:me.id+'-zcnr'
						}]
				}]
				},{
					xtype: 'panel',
					items:[{  
					    xtype: 'box', //或者xtype: 'component',  
					    height: 27, //图片高度  
					    style: {
					    	'margin-bottom':'-2px'
					    },
					    autoEl: {  
					        tag: 'img',    //指定为img标签  
					        src: 'images/syjszs/wg.png'    //指定url路径  
					    }
					},{
						xtype: 'panel',
						id:me.id+'-wgpalyer',
						layout: 'fit',
						height: 250,
						border: true,
						bodyStyle: {
							 borderColor: '#028b83',
						     backgroundColor:'#DBF2EF',
						     borderStyle: 'solid'
				        }
					},{
				    	xtype:"fieldset",
				    	title:'违规视频描述',
				    	height:225,
						style: {
							borderColor:'#40B0A3',
				            backgroundColor:'#DBF2EF',
					        'border-radius': '5px'
				        },
				        defaults: {
				    		labelWidth: 60
						},
				        border:true,
					        items:[{
								fieldLabel: '视频名称',
								xtype: 'displayfield',
								style:"margin-top:13",
								id:me.id+'-wgvName'
							},{
								fieldLabel: '详情',
								xtype: 'displayfield',
								id:me.id+'-wgnr'
							}]
					}]
				},{
					xtype: 'panel',
					items: [{  
					    xtype: 'box', //或者xtype: 'component',  
					    height: 27, //图片高度  
					    style: {
					    	'margin-bottom':'-2px'
					    },
					    autoEl: {  
					        tag: 'img',    //指定为img标签  
					        src: 'images/syjszs/bj.png'    //指定url路径  
					    }
					},{  
					    xtype: 'box',
					    padding: 1,
					    id: 'syjs-wgimg',
					    height:250,
						border: true,
						style: {
						    borderColor: '#028b83',
						    backgroundColor:'#DBF2EF',
						    borderStyle: 'solid'
						}
					},{
				    	xtype:"fieldset",
				    	title:'违规标记信息',
				    	height:225,
						style: {
							borderColor:'#EE7979',
				            backgroundColor:'#FBDFDF',
					        'border-radius': '5px'
				        },
				    	defaults: {
				    		labelWidth: 60
						},
				        border:true,
				        items:[{
							fieldLabel: '违规名称',
							xtype: 'displayfield',
							id: 'syjs-wgmc'
						},{
							fieldLabel: '发生时间',
							xtype: 'displayfield',
							id: 'syjs-wgsj'
						},{
							fieldLabel: '详细描述',
							xtype: 'displayfield',
							id: 'syjs-wgxq'
						}]
					}]
					
				},
				{
				 xtype: 'panel',
				 height:30,
				 columnWidth: 1,
				 defaults: {
					 margin:'0 0 0 10'
				},
				 items: [{
						 xtype:'button',
						 text:'全部播放',
						 iconCls: 'icon-play',
						 handler: function(){
							 var zcIsPaly=Ext.getCmp(me.id+'-zcpalyer').down('player').isPlay();
							 var wgIsPaly=Ext.getCmp(me.id+'-wgpalyer').down('player').isPlay();
							 if(zcIsPaly==false){
								 Ext.getCmp(me.id+'-zcpalyer').down('player').play();
							 }
							 if(wgIsPaly==false){
								 Ext.getCmp(me.id+'-wgpalyer').down('player').play();
							 }
							 
						 }
				    },{
						 xtype:'button',
						 text:'全部暂停',
						 iconCls: 'icon-pause',
						 handler: function(){
							 Ext.getCmp(me.id+'-zcpalyer').down('player').pause();
							 Ext.getCmp(me.id+'-wgpalyer').down('player').pause();
						 }
				    },{
						 xtype:'button',
						 iconCls: 'icon-tostart',
						 text:'上一组',
						 handler: function(){
							 if(me.getVindex() !=0){
								 me.setVindex(me.getVindex()-1);
								me.switchVideo();
							 }else{
								 Ext.Msg.alert('提示', '已经是第一组视频了');
							 }
						 }
				    },{
						 xtype:'button',
						 iconCls: 'icon-toend',
						 text:'下一组',
						 handler: function(){
							 if(me.store.getCount()-1< me.getVindex()+1){
								 Ext.Msg.alert('提示', '已经是最后一组视频了');
							 }else{
								 me.setVindex(me.getVindex()+1);
								 me.switchVideo();
							 }
						 }
				    }
				 ]
				}
		 ]
	});
		me.items = [centerPanel];
		me.callParent();
	},
	
	changePwd: function(con){
    	var me = this;
    	Ext.create('Ext.window.Window',{
			title: con == "first" ? user.username+'-首次登陆，请修改密码！' : user.username+'-密码过期，请修改密码！',
			width: 400,
			height: 249,
			modal: true,
			layout: 'fit',
			buttonAlign: 'center',
			items: [{
				xtype: 'form',
				layout: 'column',
				border: false,
				bodyPadding: 15,
				defaults: {columnWidth: 1,margin: 5,labelWidth: 65,allowBlank: false},
				items: [{
					fieldLabel: '账号',
					xtype: 'textfield',
					name: 'account',
					value: user.account,
					readOnly: true
				},{
					fieldLabel: '旧密码',
					xtype: 'textfield',
					name: 'oldpwd',
					inputType: 'password',
					maxLength:25
				},{
					fieldLabel: '新密码',
					xtype: 'textfield',
					name: 'newpwd0',
					inputType: 'password',
					maxLength:25
				},{
					fieldLabel: '确认密码',
					xtype: 'textfield',
					name: 'newpwd1',
					inputType: 'password',
					maxLength:25
				},{
					fieldLabel: '验证码',
					xtype: 'textfield',
					columnWidth: .81,
					name: 'vcode'
				},{
					xtype: 'box',
					id:'meupdatepwd',
					columnWidth: .19,
					height: 24,
					refresh: function(dom){
						dom.src="user/getVimg.do?id="+new Date().getTime();
					},
					listeners: {
						beforerender: function(box){
							box.html = '&nbsp;&nbsp;&nbsp;&nbsp;<img style="height:25px;position:absolute; top:146px; left:308px;cursor:hand" src="'
								+ 'user/getVimg.do?id='+new Date().getTime() + ' title="点击刷新" onclick="Ext.getCmp(\''+box.id+'\').refresh(this);"></img>';
						}
					}
				}]
			}],
			buttons: [{
				text: '保存',
				handler: function(){
					var formp = this.up('window').down('form');
        	    	var form = formp.form;
        	    	var formdata = form.getValues();
        	    	var oldpwd = form.findField('oldpwd').getValue();
        	    	var newpwd0 = form.findField('newpwd0').getValue();
        	    	var newpwd1 = form.findField('newpwd1').getValue();
        	    	formdata.oldpwd = hex_sha1(oldpwd);
        	    	formdata.newpwd0 = hex_sha1(newpwd0);
        	    	formdata.newpwd1 = hex_sha1(newpwd1);
        	    	if(form.isValid()){
//        	    		form.submit({
//            	    	    url: 'user/changePwd.do',
//            	    	    success: function(form, action) {
//            	    	    	var rs = Ext.decode(action.response.responseText);
//            	    	    	if(rs.rst){
//            	    	    		Ext.Msg.alert('提示', '保存成功！');
//            	    	    		formp.up('window').close();
//            	    	    	}
//            	    	    	else{
//            	    	    		Ext.Msg.alert('提示', '保存失败！详情：<br>'+rs.msg);
//            	    	    	}
//            	    	    }
//            	    	});
        	    		Ext.Ajax.request({
						    url: 'user/changePwd.do',
						    params:formdata,
						    success: function(response){
						        var rs = Ext.decode(response.responseText);
						        if(rs.rst){
            	    	    		Ext.Msg.alert('提示', '保存成功！');
            	    	    		formp.up('window').close();
            	    	    	}
            	    	    	else{
            	    	    		Ext.Msg.alert('提示', '保存失败！详情：<br>'+rs.msg);
            	    	    	}
						    }
						});
        	    	}
        	    	else{
        	    		Ext.Msg.alert('提示', '请填写完整的表单！');
        	    	}
				}
			}]
		}).show();
    },
	/**
	 * 循环播放视频
	 */
	switchVideo: function(){
		var me=this;
		var index= me.getVindex();
		var me = this;
		var rec = me.store.getAt(index);
		var t = me.store.getCount();
		if(index >=0 && index < t){
			Ext.getCmp(me.id+'-bt').update({
				html: '<span style="font-size: 18px;font-weight: bold;">警示内容：'+rec.raw.title+'</span>'
			});
			Ext.getCmp(me.id+'-zcpalyer').remove(Ext.getCmp(me.id+'-zcpalyer').down('player'));
			Ext.getCmp(me.id+'-wgpalyer').remove(Ext.getCmp(me.id+'-wgpalyer').down('player'));
			Ext.getCmp(me.id+'-zcvName').setValue(rec.raw.zcvName);
			Ext.getCmp(me.id+'-zcnr').setValue(rec.raw.zcnr);
			Ext.getCmp(me.id+'-wgvName').setValue(rec.raw.wgvName);
			Ext.getCmp(me.id+'-wgnr').setValue(rec.raw.wgnr);
			Ext.getCmp(me.id+'-zcpalyer').add({
				xtype: 'player',
				height:250,
				autoPlay: false,
				autoLoadVideo: false,
				vdata: {id: rec.raw.zcvideoId},
				hides: ['sign'],
				src: rec.raw.zcSynpath
			});
			
			Ext.getCmp(me.id+'-wgpalyer').add({
				xtype: 'player',
				autoPlay: false,
				autoLoadVideo: false,
				vdata: {id: rec.raw.wgvideoId},
				hides: ['sign'],
				src: rec.raw.wgSynpath,
				onloadeddata:function(){
					me.updateMd(Ext.getCmp(me.id+'-wgpalyer').down('player'),rec.raw.wgvideoId);
				}
			});
		}
		
	},
	ruanTask: function(){
		var me = this;
		Ext.TaskManager.start({//定时器	
			interval: 500,
			run: function(){
				try {
					
					var p2 = Ext.getCmp(me.id+'-wgpalyer').down('player');
					if(p2){
						var time = p2.getCurrentTime();
						var bjs = me.getBjs();
						for ( var i = bjs.length-1; i >= 0; i--) {
							var bj = bjs[i];
							if(bj.wgtime < time){
								if(me.bjid != bj.id){
									Ext.getCmp('syjs-wgimg').update({
										html: '<img width="100%" height="100%" src="wgVideoAction/getWgImg.do?wgtime='+bj.wgtime+'&videoId='+bj.videoId+'"/>'
									});
									Ext.getCmp('syjs-wgmc').setValue(bj.title);
									Ext.getCmp('syjs-wgsj').setValue(me.formatSeconds(bj.wgtime));
									Ext.getCmp('syjs-wgxq').setValue(bj.describe);
									me.bjid = bj.id;
								}
								
								break;
							}
						}
					}
					
				} catch (e) {
				}
			}
		});
	},
	updateMd: function(c,videoId){//c:player、vindex:视频id
		var me = this;
		$('div[md]',c.el.dom).remove();
		var prbar = c.down('progressbar');
		$(prbar.el.dom).append("<div md style='filter: alpha(opacity=50); opacity:0.5;postion:relative;width:100%;height:100%;'></div>");
		Ext.Ajax.request({
		    url: 'wgVideoAction/getWgBj.do',
		    params: {videoId:videoId},
		    success: function(response){
		        var text = response.responseText;
		        var data = Ext.decode(text);
		        me.setBjs(data);
		        for ( var key in data) {
		        	me.renderMd(c,data[key]);
				}
		    }
		});
	},
	renderMd: function(c,data){
		var me=this;
		var time = data.wgtime,text=data.text;
		var p = c;
		var prbar = p.down('progressbar');
		var left = time*(prbar.getWidth()/p.getAllTime());
		c.goToTime(parseInt(time));
		var md = $('<div></div>').css('display','inline-block').css('position','absolute').css('opacity',100).css('filter','alpha(opacity=100)')
		.css('background','red').css('height','100%').css('cursor','pointer').css('margin-left',left).width(2)
		.data('data',data).click(function(e){
		});
		$('div[md=]',c.el.dom).append(md);
		Ext.QuickTips.register({
			target: md[0],
			title: '描点,'+data.title,
			text: text,//具体要提示的东西
			width: 200,
			dismissDelay: 100000
		});
	},
	/**
	 * 将秒转换为时间
	 * @param value
	 * @returns {String}
	 */
	formatSeconds : function(value){
		var theTime = parseInt(value);// 秒
		var theTime1 = 0;// 分
		var theTime2 = 0;// 小时
	    if(theTime > 60) {
	        theTime1 = parseInt(theTime/60);
	        theTime = parseInt(theTime%60);
	            if(theTime1 > 60) {
	            theTime2 = parseInt(theTime1/60);
	            theTime1 = parseInt(theTime1%60);
	            }
	    }
        var result = ""+parseInt(theTime);
        if(theTime1 > 0) {
        	result = ""+parseInt(theTime1)+":"+result;
        }
        if(theTime2 > 0) {
        	result = ""+parseInt(theTime2)+":"+result;
        }
        var r= result.indexOf(":");
        if(r==-1){
        	result="0:"+result;
        }
        return result;
    },
    /**
     * 得到公示公告栏数据
     */
    getGsggList :function(){
    	var me = this;
    	Ext.Ajax.request({
    		url: 'GsggAction/getGsggList.do',
		    success: function(response){
		        var text = response.responseText;
		        var data = Ext.decode(text);
		        for ( var key in data) {
		        	var title=data[key].title;
		        	if(data[key].title.length>10){
		        		title=data[key].title.substr(0,10)+"...";
		        	}
		        	$("#gsggListTab").append('<tr>'
		        			+'<td style="width:40%"><a style="text-decoration:none;" href="javascript:Ext.getCmp(\''+me.id
		        			+'\').getGsggWin(\''+data[key].id+'\',\''+data[key].title+'\',\''+data[key].nr+'\',\''
		        			+data[key].name+'\',\''+Ext.Date.format(new Date(data[key].uptime),'Y-m-d')
		        			+'\',\''+data[key].hasimg+'\')"><lable style="font-size:18px;font-weight: bold;color:#0E8B7B;">.&nbsp;</lable>' + title+'</a></td>'
		        			+'<td style="width:30%">来自：'+data[key].name+'</td>'
		        			+'<td style="width:20%;"><span >' + Ext.Date.format(new Date(data[key].uptime),'Y-m-d')+'</span></td></tr>');
				}
		    }
		});
    },
    /**
     * 初始化滚动图片
     */
    initLoopImg: function(){
    	var me = this;
    	Ext.Ajax.request({
    		url: 'GsggAction/getImgs.do',
    		success: function(response){
    			var imgs = Ext.decode(response.responseText);
    			var length = imgs.length;
    			if(length > 0){
    				var looper = $("#img-loop");
    				$('img',looper)/*.width(looper.width()).height(260)*/.data('index',1);
    				$('img',looper).attr('src','GsggAction/getImg.do?id='+imgs[0].id);
    				$('#imgId').val(imgs[0].id);
    				$('#imgTitle').val(imgs[0].title);
    				$('#imgNr').val(imgs[0].nr);
    				$('#imgUserName').val(imgs[0].name);
    				$('#imgUptime').val(imgs[0].uptime);
        			$('.img-loop-bar').text("[1/"+length+"]");
        			$('.img-loop-prev',looper).click(function(){
        				var index = $('img',looper).data('index')-1;
        				index = index < 1 ? length : index;
        				$('img',looper).data('index',index);
        				$('img',looper).attr('src','GsggAction/getImg.do?id='+imgs[index-1].id);
        				$('#imgId').val(imgs[index-1].id);
        				$('#imgTitle').val(imgs[index-1].title);
        				$('#imgNr').val(imgs[index-1].nr);
        				$('#imgUserName').val(imgs[index-1].name);
        				$('#imgUptime').val(imgs[index-1].uptime);
        				$('.img-loop-bar').text("["+index+"/"+length+"]");
        			});
        			$('.img-loop-next',looper).click(function(){
        				var index = $('img',looper).data('index')+1;
        				index = index > length ? 1 : index;
        				$('img',looper).data('index',index);
        				$('img',looper).attr('src','GsggAction/getImg.do?id='+imgs[index-1].id);
        				$('#imgId').val(imgs[index-1].id);
        				$('#imgTitle').val(imgs[index-1].title);
        				$('#imgNr').val(imgs[index-1].nr);
        				$('#imgUserName').val(imgs[index-1].name);
        				$('#imgUptime').val(imgs[index-1].uptime);
        				$('.img-loop-bar').text("["+index+"/"+length+"]");
        			});
        			var runner = new Ext.util.TaskRunner();
        			me.task = runner.newTask({
						run: function () {
							$('.img-loop-next',$("#img-loop")).trigger('click');
						},
						interval: 3000
					}).start();
        			
        			me.on('beforedestroy',function(){
        				if(me.task)me.task.stop();
        			});
    			}
    		}
    	});
    },
    /**
     * 公告信息窗体
     * @param id
     * @param title
     * @param nr
     * @param name
     * @param uptime
     */
    getGsggWin: function(id,title,nr,name,uptime,hasimg){
		var me = this;
		Ext.create('Ext.window.Window',{
			width: 1000,
			height: 500,
			iconCls: 'icon-edit',
			modal: true,
			layout: 'fit',
			title: '公告信息',
			buttons: [{
				text: '关闭',
				handler: function(){
					this.up('window').close();
				}
			}],
			items: {
					bodyPadding: 10,
					fileUpload: true, 
					layout: 'fit',
					xtype: 'panel',
					autoScroll: true,
					bodyStyle: {
					     backgroundColor:'white'
			        },
					border:false,
					html:'<div style="margin:20px;background-color:white;">'
								+'<div style="font-size: 26px;font-weight: bold;width:100%;text-align:center;">'
									+'<lable>'+title+'</lable>'
								+'</div>'
								+'<div style="font-size: 12px;width:28%;float:right;margin-top:5px;">'
									+'<lable>来自：'+name+'</lable><lable style="margin-left:15px;">'+uptime+'</lable>'
								+'</div>'
								+'<div style="width:100%;margin-top:30px;">'	
									+(hasimg == 1 ? '<img width="100%" height="250" src="GsggAction/getGsggImg.do?id='+id+'"/>' : '')
								+'</div>'
								+'<div style="margin-top:20px;display:block;word-break: break-all;word-wrap: break-word;">'
									+nr+''
								+'</div>'
							+'</div>'
			}
		}).show();
		
    },
    /**
     * 点击更多跳转到公告管理
     */
    genduoWin : function (){
    	var tab = Ext.getCmp('desk-content');
    	var c = Ext.getCmp('menu-Module.System.Gsgg');
    	if(!c){
    		c = Ext.create('Module.System.Gsgg',{
    			id: 'menu-Module.System.Gsgg',
    			closable: true,
    			ptitle: '系统管理',
    			title: '公告管理'
    		});
    		tab.add(c);
    	}
    	
    	tab.setActiveTab(c);
    },
    /**
     * 点击图片弹出窗口
     */
    getImgclick : function(){
    	var me=this;
    	var id=$("#imgId").val();
    	if(id && id != ''){
    		var title=$("#imgTitle").val();
        	var nr=$("#imgNr").val();
        	var userName=$("#imgUserName").val();
        	var uptime=parseInt($("#imgUptime").val());
        	me.getGsggWin(id,title,nr,userName,Ext.Date.format(new Date(uptime),'Y-m-d'),1);
    	}
    }
});

